// 对axios二次封装
import axios from "axios"

const requests = axios.create({
    baseURL: "/api",
    timeout: 500000,
})

// 请求拦截器
requests.interceptors.request.use((config) => {
        config.headers.token = '1111111111';
})
// 响应拦截器
requests.interceptors.response.use(((res) => {
    return res.data;
}, () => {
    return Promise.reject(new Error('fial'));
}))


export default requests;